package com.cci.kangdao.ecjv.controller;

import com.cci.kangdao.dto.BaseResponse;
import com.cci.kangdao.ecjv.dto.ECJVComponentKenDto;
import com.cci.kangdao.ecjv.service.ECJVComponentKenService;
import com.cci.kangdao.service.impl.SMSEnum;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description: 零件信息
 * @author: 商伟
 * @company: CTY
 * @since: 2022/10/24 13:56
 * @version: V1.0
 **/
@RestController
@RequestMapping("/ecjvComponentKen")
public class ECJVComponentKenController {

    @Resource
    private ECJVComponentKenService ecjvComponentKenService;

    /**
     * 获取件包信息
     * @return
     */
    @RequestMapping(value = "getKenList.aspx")
    public BaseResponse getKenList() {
        List<ECJVComponentKenDto> list = ecjvComponentKenService.getKenList();
        return BaseResponse.success(list);
    }

    /**
     * 将该路线设置为常用路线
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "getpdfListById.aspx")
    public BaseResponse getpdfListById(Long id) {
        if (null == id) {
            return BaseResponse.error(SMSEnum.type17.getIndex(), "参数不能为空");
        }
        List<ECJVComponentKenDto> list = ecjvComponentKenService.getpdfListById(id);
        return BaseResponse.success(list);
    }

}
